CXX_SRC = $(wildcard ./src/*.cpp)
CXX__O = $(wildcard ./src/*.o)
CXX_OBJ = $(patsubst %cpp, %o, $(CXX_SRC))
I_DIR = -I ./include
CXX_BIN = main
CXX_CLEAN = clean
CXXFLAGS = '-std=c++11'

$(CXX_BIN): $(CXX_OBJ)
	$(CXX) $^ -o $@ $(I_DIR)

BASE = report
LATEX = doc
PDF = $(BASE).pdf
DVI = $(BASE).dvi
TEX = $(BASE).tex
LOG = $(BASE).log
AUX = $(BASE).aux
OUT = $(BASE).out
TEX_TYPE = xelatex
DVI_PDF = dvipdfm

$(LATEX): $(PDF)

$(PDF): $(DVI)
	$(DVI_PDF) $^ -o
	
$(DVI): $(TEX)
	$(TEX_TYPE) $^

.PHONY: $(CXX_CLEAN)
$(CXX_CLEAN):
	$(RM) $(CXX__O) $(CXX_BIN) $(LOG) $(DVI) $(AUX) $(OUT) $(PDF)
